home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: faster than printf?
- Date: Fri, 09 Feb 96 01:55:50 GMT
- Organization: none
- Message-ID: <823830950snz@genesis.demon.co.uk>
- References: <4fa96e$dv8@newsgate.dircon.co.uk> <4fc09j$eji@qns2.qns.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4fc09j$eji@qns2.qns.com>
- mjarvis@qns2.qns.com "Michael Jarvis" writes:
-
- >Kai Chan (Kai Chan (kai@cell.co.uk)) wrote:
- >
- >> Does anyone know of a less expensive way of outputting text
- >> than using printf? I'm programming on a UNIX box[Silicon Graphics]
- >
- >If you don't need to format the text then I've found fputs() to work much
- >faster.
-
- This is something that is system dependent and you need to test on your
- particular system. On the one I use here printf() is marginally faster
- than fputs() with fwrite() being the fastest stdio function and putc()
- slow. It may be possible to improve matters with careful use of setvbuf().
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-